﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Webtest_view.DbFunction;

namespace Webtest_view
{
    public partial class ViewDate : System.Web.UI.Page
    {
        int _id;
        dbConnect conn;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            _id = Convert.ToInt32(DropDownList1.SelectedItem.Text);

            String delete_query = "delete from [user] where id='"+_id+"'";

            try
            {
                conn = new dbConnect();
                conn.deleteValue(delete_query);
                Label1.Text = "Delete Complete";
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }


        }
    }
}
